<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.12.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>avalon: E:/avalon/src/libavalon/connect_handler.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">avalon
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.12.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() { codefold.init(0); });
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search',false);
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){ initResizable(false); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_f51b14f5b402f75e5fe3fdf41b0bea7b.html">libavalon</a></li>  </ul>
</div>
</div><!-- top -->
<div id="doc-content">
<div class="header">
  <div class="headertitle"><div class="title">connect_handler.h</div></div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="preprocessor">#ifndef CONNECT_HANDLER_H</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="preprocessor">#define CONNECT_HANDLER_H</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span> </div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="preprocessor">#include &quot;amqpcpp.h&quot;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span><span class="preprocessor">#include &quot;amqpcpp/libevent.h&quot;</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span> </div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="keyword">class </span><a class="code hl_class" href="class_connecter.html">Connecter</a>;</div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span> </div>
<div class="foldopen" id="foldopen00014" data-start="{" data-end="};">
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"><a class="line" href="class_connect_handler.html">   14</a></span><span class="keyword">class </span><a class="code hl_class" href="class_connect_handler.html">ConnectHandler</a> : <span class="keyword">public</span> AMQP::LibEventHandler {</div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="keyword">public</span>:</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span>    <a class="code hl_function" href="class_connect_handler.html#aaadcf2239c5b49df6595fb8d48ec8388">ConnectHandler</a>(<span class="keyword">struct</span> event_base *evbase, <a class="code hl_class" href="class_connecter.html">Connecter</a> *connecter);</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span> </div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span>    <span class="keywordtype">void</span> <a class="code hl_function" href="class_connect_handler.html#ac3b34503db4c6123cb867ec34079e95c">onConnected</a>(AMQP::TcpConnection *connection) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span> </div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span>    <span class="keywordtype">void</span> <a class="code hl_function" href="class_connect_handler.html#aeadd218fe0b87bb25401d9e16bd3185a">onHeartbeat</a>(AMQP::TcpConnection *connection) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span> </div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span>    <span class="keywordtype">void</span> <a class="code hl_function" href="class_connect_handler.html#a05d1142c9f560128dd061aa3de78f14e">onLost</a>(AMQP::TcpConnection *connection) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span> </div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno">   51</span>    <span class="keywordtype">void</span> <a class="code hl_function" href="class_connect_handler.html#ad8d9859ce53aadf2c2992150f43c0767">onError</a>(AMQP::TcpConnection *connection, <span class="keyword">const</span> <span class="keywordtype">char</span> *message) <span class="keyword">override</span>;</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno">   52</span> </div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span><span class="keyword">private</span>:</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno">   57</span>    <a class="code hl_class" href="class_connecter.html">Connecter</a> *connecter_;</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno">   58</span>};</div>
</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno">   59</span> </div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno">   60</span><span class="preprocessor">#endif </span><span class="comment">// CONNECT_HANDLER_H</span></div>
<div class="ttc" id="aclass_connect_handler_html"><div class="ttname"><a href="class_connect_handler.html">ConnectHandler</a></div><div class="ttdoc">ConnectHandler类继承自AMQP::LibEventHandler，用于处理与AMQP相关的事件， 如连接建立、心跳接收、连接丢失和错误等。</div><div class="ttdef"><b>Definition</b> connect_handler.h:14</div></div>
<div class="ttc" id="aclass_connect_handler_html_a05d1142c9f560128dd061aa3de78f14e"><div class="ttname"><a href="class_connect_handler.html#a05d1142c9f560128dd061aa3de78f14e">ConnectHandler::onLost</a></div><div class="ttdeci">void onLost(AMQP::TcpConnection *connection) override</div><div class="ttdoc">当连接丢失时调用。</div><div class="ttdef"><b>Definition</b> connect_handler.cpp:20</div></div>
<div class="ttc" id="aclass_connect_handler_html_aaadcf2239c5b49df6595fb8d48ec8388"><div class="ttname"><a href="class_connect_handler.html#aaadcf2239c5b49df6595fb8d48ec8388">ConnectHandler::ConnectHandler</a></div><div class="ttdeci">ConnectHandler(struct event_base *evbase, Connecter *connecter)</div><div class="ttdoc">构造函数，初始化ConnectHandler对象。</div><div class="ttdef"><b>Definition</b> connect_handler.cpp:6</div></div>
<div class="ttc" id="aclass_connect_handler_html_ac3b34503db4c6123cb867ec34079e95c"><div class="ttname"><a href="class_connect_handler.html#ac3b34503db4c6123cb867ec34079e95c">ConnectHandler::onConnected</a></div><div class="ttdeci">void onConnected(AMQP::TcpConnection *connection) override</div><div class="ttdoc">当建立连接时调用。</div><div class="ttdef"><b>Definition</b> connect_handler.cpp:11</div></div>
<div class="ttc" id="aclass_connect_handler_html_ad8d9859ce53aadf2c2992150f43c0767"><div class="ttname"><a href="class_connect_handler.html#ad8d9859ce53aadf2c2992150f43c0767">ConnectHandler::onError</a></div><div class="ttdeci">void onError(AMQP::TcpConnection *connection, const char *message) override</div><div class="ttdoc">当发生错误时调用。</div><div class="ttdef"><b>Definition</b> connect_handler.cpp:25</div></div>
<div class="ttc" id="aclass_connect_handler_html_aeadd218fe0b87bb25401d9e16bd3185a"><div class="ttname"><a href="class_connect_handler.html#aeadd218fe0b87bb25401d9e16bd3185a">ConnectHandler::onHeartbeat</a></div><div class="ttdeci">void onHeartbeat(AMQP::TcpConnection *connection) override</div><div class="ttdoc">当接收到心跳时调用。</div><div class="ttdef"><b>Definition</b> connect_handler.cpp:15</div></div>
<div class="ttc" id="aclass_connecter_html"><div class="ttname"><a href="class_connecter.html">Connecter</a></div><div class="ttdoc">定义一个连接器类，用于建立和维护与消息队列服务器的连接</div><div class="ttdef"><b>Definition</b> connecter.h:24</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.12.0
</small></address>
</div><!-- doc-content -->
</body>
</html>
